package com.tanhua.server.service;

import com.tanhua.domain.mongo.UserLocation;
import com.tanhua.dubbo.api.UserLocationApi;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

/**
 * @author anshuai
 * @create 2021-02-09 0:01
 */
@Service
public class BaiduService {

    @Reference
    private UserLocationApi userLocationApi;

    /**
     * 上报地理位置
     */
    public ResponseEntity saveLocation(Double latitude, Double longitude, String address) {
        //1.保存地理位置
        userLocationApi.save(latitude,longitude,address, UserHolder.getUserId());
        return ResponseEntity.ok(null);
    }
}
